//
//  NewSongReusableView.m
//  YHYRealx
//
//  Created by yanghuiyan on 16/4/27.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "NewSongReusableView.h"
#define Width self.bounds.size.width
#define Height self.bounds.size.height
@implementation NewSongReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithRed:0.14 green:0.18 blue:0.22 alpha:1.00];
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10*Width/416, 10* Height/736, 100*Width/416, Height - 10*Height/736 )];
        label.text = @"新歌新碟";
        label.textColor = [UIColor colorWithRed:0.88 green:0.88 blue:0.89 alpha:1.00];
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont boldSystemFontOfSize:18];
        [self addSubview:label];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
        button.frame = CGRectMake(Width - 60*Width/416,0, 60*Width/416, Height);
        [button setTitle:@"全部 >" forState:UIControlStateNormal];
        button.tintColor = [UIColor colorWithRed:0.57 green:0.59 blue:0.62 alpha:1.00];
        [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:button];
        
        [label release];
        
    }
    return self;
}

- (void)buttonAction:(UIButton *)sender {
    [self.delegate push];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
